local thbattle__xiaosan_jingxia = fk.CreateSkill {

  name = "thbattle__xiaosan_jingxia",

  tags = {  },

}



thbattle__xiaosan_jingxia:addEffect("active", {
  name = "thbattle__xiaosan_jingxia",
  prompt = "#thbattle__xiaosan_jingxia-active",
  anim_type = "offensive",
  max_phase_use_time = 1,
  card_num = 1,
  card_filter =function (self, player, to_select, selected)
     return #selected < 1 and table.contains(player:getCardIds("h"), to_select) and
        Fk:getCardById(to_select).suit ~= Card.NoSuit
  end,
  target_filter =function (self, player, to_select, selected, selected_cards, card, extra_data)
        return #selected == 0 and to_select ~= player
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local choice_suit = room:askToChoice(target,{
      choices = { "log_heart", "log_spade", "log_diamond", "log_club" },
      prompt = "#thbattle__xiaosan_jingxia-choose_suit:" .. player.id,
      skill_name = thbattle__xiaosan_jingxia.name,
      cancelable = false,
    })
    room:obtainCard(target, effect.cards, true, fk.ReasonGive, player, thbattle__xiaosan_jingxia.name, "@@thb_mingpai")
    if Fk:getCardById(effect.cards[1]).suit ~= U.ConvertSuit(choice_suit, "sym", "int") then
      room:damage({
        from = player,
        to = target,
        damage = 1,
        skillName = thbattle__xiaosan_jingxia.name
      })
    end
  end,
})

return thbattle__xiaosan_jingxia